package com.tramy.hpush.server.data;

import com.google.gson.annotations.SerializedName;

import java.util.ArrayList;
import java.util.List;

public class Message {
    @SerializedName("data")
    private String data;

    @SerializedName("android")
    private AndroidConfig androidConfig;

    @SerializedName("token")
    private List<String> token;

    private Message(Builder builder) {
        this.data = builder.data;
        this.androidConfig = builder.androidConfig;
        this.token = builder.token;
    }

    public String getData() {
        return data;
    }

    public AndroidConfig getAndroidConfig() {
        return androidConfig;
    }

    public List<String> getToken() {
        return token;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private String data;
        private AndroidConfig androidConfig;
        private List<String> token;

        private Builder() {
            token = new ArrayList<>();
        }

        public Builder setData(String data) {
            this.data = data;
            return this;
        }

        public Builder setAndroidConfig(AndroidConfig androidConfig) {
            this.androidConfig = androidConfig;
            return this;
        }

        public Builder addToken(String token) {
            this.token.add(token);
            return this;
        }

        public Builder addAllToken(List<String> tokens) {
            this.token.addAll(tokens);
            return this;
        }

        public Message build() {
            return new Message(this);
        }
    }

}
